using System;


namespace WebCrawler
{
	/// <summary>
	/// Interface to classes that encapsulates connection to a server using a TCP socket.
	/// The intention is to use the HTTP protocol, but other protocols might be used as well.
	/// </summary>
	/// 
	public interface IHttp
	{

		/// <summary>
		/// Opens the connection to the server with passed timeout
		/// Pre:	The server can be reached by the url
		/// Post:	Connection etablished
		/// </summary>
		/// <param name="url">Identification of the server. i.e a dns name or a ip address</param>
		/// <param name="timeout">timeout interval</param>
		void Open(string url, int timeout);

		/// <summary>
		/// Gets a stream object to the server object, that might be used for common stream operations.
		/// Pre:	A connection is etablished to the server
		/// Post:	A stream object is returned, i.e a NetworkStream object.
        /// Caution throws exception on bad url or timeout
		/// </summary>
		/// <returns>a stream object</returns>
		System.IO.Stream GetStream();
	}


}
